package com.singzi.designPattern.strategyMode;

public class CashChoice {
    CashSuper cash;
    public CashChoice(int type) {
        switch (type){
            case 1:
                cash = new CashNormal();
                break;
            case 2:
                cash = new CashRebate(0.8);
                break;
            case 3:
                cash = new CashReturn(300,30);
                break;
        }
    }
    public double getResult(double money){
        return cash.acceptCash(money);
    }
}
